/**
 * CS 4335 Project - Transportation Challenge
 * @author Dan Flannery
 *
 */


public class BinaryNode<T> {

  private BinaryNode leftChild, rightChild;
  private T data;
  private T key;

  public BinaryNode() {
    leftChild = rightChild = null;
    data = null;
    key = null;
  }

  public BinaryNode(BinaryNode<T> leftChild, BinaryNode<T> rightChild, T data) {
    this.leftChild = leftChild;
    this.rightChild = rightChild;
    this.data = data;
    this.key = key;
  }

  public T getData() {
    return this.data;
  }

  public void setData(T data) {
    this.data = data;
  }
  
  public BinaryNode getLeftChild() {
    return this.leftChild;
  }

  public void setLeftChild(BinaryNode<T> leftChild) {
    this.leftChild = leftChild;
  }

  public BinaryNode getRightChild() {
    return this.rightChild;
  }

  public void setRightChild(BinaryNode<T> rightChild) {
    this.rightChild = rightChild;
  }

  public boolean hasChildren() {
    if (this.rightChild != null || this.leftChild != null)
      return true;
    else
      return false;
  }

  public boolean hasRightChild() {
    if (this.rightChild != null)
      return true;
    else
      return false;
  }

  public boolean hasLeftChild() {
    if (this.leftChild != null)
      return true;
    else
      return false;
  }

  public boolean hasData() {
    if (this.data != null)
      return true;
    else
      return false;
  }


}//end class


